package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.SchemeType;

import javax.validation.Valid;
import java.math.BigDecimal;
import javax.validation.constraints.NotNull;
import java.util.List;

import static org.jsola.hr.example.SocProgExample.*;
import static org.jsola.hr.example.SocProgExample.E_COMPANY_ID;
import static org.jsola.hr.example.SocProgExample.E_DEDUCTIONS_DATE;
import static org.jsola.hr.example.SocProgExample.E_ISSUE;
import static org.jsola.hr.example.SocProgExample.E_ME_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.E_ME_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.E_ONLY_SOC_AMOUNT;
import static org.jsola.hr.example.SocProgExample.E_PARENT_ID;
import static org.jsola.hr.example.SocProgExample.E_PAY_PROVIDENT_FUND;
import static org.jsola.hr.example.SocProgExample.E_PF_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.E_PF_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.E_PROG_NAME;
import static org.jsola.hr.example.SocProgExample.E_SERVICE_COST;
import static org.jsola.hr.example.SocProgExample.E_SOC_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.E_SOC_CITY;
import static org.jsola.hr.example.SocProgExample.E_SOC_CITY_NAME;
import static org.jsola.hr.example.SocProgExample.E_SOC_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.E_SOURCE_ID;
import static org.jsola.hr.example.SocProgExample.E_TYPE;
import static org.jsola.hr.example.SocProgExample.M_COMPANY_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_PARENT_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_ME_ACCOUNT_MAX;
import static org.jsola.hr.example.SocProgExample.M_ME_TEMPLATE_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_PF_ACCOUNT_MAX;
import static org.jsola.hr.example.SocProgExample.M_PF_TEMPLATE_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_PROG_NAME_MAX;
import static org.jsola.hr.example.SocProgExample.M_PROG_NAME_NOT_NULL;
import static org.jsola.hr.example.SocProgExample.M_SOC_ACCOUNT_MAX;
import static org.jsola.hr.example.SocProgExample.M_SOC_CITY_MAX;
import static org.jsola.hr.example.SocProgExample.M_SOC_CITY_NAME_MAX;
import static org.jsola.hr.example.SocProgExample.M_SOC_TEMPLATE_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_SOURCE_ID_MAX;
import static org.jsola.hr.example.SocProgExample.M_TYPE_ENUM_NOT_MATCH;
import static org.jsola.hr.example.SocProgExample.N_COMPANY_ID;
import static org.jsola.hr.example.SocProgExample.N_DEDUCTIONS_DATE;
import static org.jsola.hr.example.SocProgExample.N_ISSUE;
import static org.jsola.hr.example.SocProgExample.N_ME_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.N_ME_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.N_ONLY_SOC_AMOUNT;
import static org.jsola.hr.example.SocProgExample.N_PARENT_ID;
import static org.jsola.hr.example.SocProgExample.N_PAY_PROVIDENT_FUND;
import static org.jsola.hr.example.SocProgExample.N_PF_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.N_PF_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.N_PROG_NAME;
import static org.jsola.hr.example.SocProgExample.N_SERVICE_COST;
import static org.jsola.hr.example.SocProgExample.N_SOC_ACCOUNT;
import static org.jsola.hr.example.SocProgExample.N_SOC_CITY;
import static org.jsola.hr.example.SocProgExample.N_SOC_CITY_NAME;
import static org.jsola.hr.example.SocProgExample.N_SOC_TEMPLATE_ID;
import static org.jsola.hr.example.SocProgExample.N_SOURCE_ID;
import static org.jsola.hr.example.SocProgExample.N_TYPE;

/**
 * 参保方案表
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【参保方案表】的参数")
@Data
public class SocProgAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_DEDUCTIONS_DATE, example = E_DEDUCTIONS_DATE)
    private Integer deductionsDate;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = SchemeType.VALUES_STR)
    @Const(constClass = SchemeType.class, message = M_TYPE_ENUM_NOT_MATCH)
    private Integer type;

    @ApiModelProperty(notes = N_SERVICE_COST, example = E_SERVICE_COST)
    private BigDecimal serviceCost;

    @ApiModelProperty(notes = N_PROG_NAME, example = E_PROG_NAME, required = true)
    @NotNull(message = M_PROG_NAME_NOT_NULL)
    @Length(max = 255, message = M_PROG_NAME_MAX)
    private String progName;

    @ApiModelProperty(notes = N_SOURCE_ID, example = E_SOURCE_ID)
    @Length(max = 32, message = M_SOURCE_ID_MAX)
    private String sourceId;

    @ApiModelProperty(notes = N_SOC_CITY, example = E_SOC_CITY)
    @Length(max = 255, message = M_SOC_CITY_MAX)
    private String socCity;

    @ApiModelProperty(notes = N_SOC_CITY_NAME, example = E_SOC_CITY_NAME)
    @Length(max = 255, message = M_SOC_CITY_NAME_MAX)
    private String socCityName;

    @ApiModelProperty(notes = N_ONLY_SOC_AMOUNT, example = E_ONLY_SOC_AMOUNT)
    private Boolean onlySocAmount;

    @ApiModelProperty(notes = N_PAY_PROVIDENT_FUND, example = E_PAY_PROVIDENT_FUND)
    private Boolean payProvidentFund;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID)
    @Length(max = 32, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_SOC_TEMPLATE_ID, example = E_SOC_TEMPLATE_ID)
    @Length(max = 32, message = M_SOC_TEMPLATE_ID_MAX)
    private String socTemplateId;

    @ApiModelProperty(notes = N_ME_TEMPLATE_ID, example = E_ME_TEMPLATE_ID)
    @Length(max = 32, message = M_ME_TEMPLATE_ID_MAX)
    private String meTemplateId;

    @ApiModelProperty(notes = N_PF_TEMPLATE_ID, example = E_PF_TEMPLATE_ID)
    @Length(max = 32, message = M_PF_TEMPLATE_ID_MAX)
    private String pfTemplateId;

    @Valid
    @ApiModelProperty(notes = N_SOC_PROG_ITEM_DO_LIST, example = E_SOC_PROG_ITEM_DO_LIST)
    private List<SocProgItemDTO> socProgItemDTOList;

    @ApiModelProperty(notes = N_SOC_ACCOUNT, example = E_SOC_ACCOUNT)
    @Length(max = 50, message = M_SOC_ACCOUNT_MAX)
    private String socAccount;

    @ApiModelProperty(notes = N_ME_ACCOUNT, example = E_ME_ACCOUNT)
    @Length(max = 50, message = M_ME_ACCOUNT_MAX)
    private String meAccount;

    @ApiModelProperty(notes = N_PF_ACCOUNT, example = E_PF_ACCOUNT)
    @Length(max = 50, message = M_PF_ACCOUNT_MAX)
    private String pfAccount;

    @ApiModelProperty(notes = N_ISSUE, example = E_ISSUE)
    private Boolean issue;


}

